/**
 * Created by wndwl on 2016/11/17.
 */
var gulp = require('gulp');
var del = require('del');
var usemin = require('gulp-usemin');

gulp.task('dist', function() {
    del('./dist').then(function () {
        //合并js、css
        (function () {
            return gulp.src('src/index.html')
                .pipe(usemin())
                .pipe(gulp.dest('dist/'));
        })();
        //转移views文件夹
        (function () {
            return gulp.src(['src/views/**/*.html'])
                .pipe(gulp.dest('dist/views'));
        })();
        //转移third-party文件夹
        (function () {
            return gulp.src(['src/third-party/**/*'])
                .pipe(gulp.dest('dist/third-party'));
        })();
    });
});